﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL.Artwork;

namespace WebApplication.User
{
    public partial class Like : System.Web.UI.Page
    {
        public int totalCount = 0;

        private ArtworkService artworkService = new ArtworkService();

        public List<Models.Artworks> artworks = new List<Models.Artworks>();
        protected void Page_Load(object sender, EventArgs e)
        {
            int queryId = Convert.ToInt32(Request.QueryString["id"]);

            if (Session["UID"] == null)
            {
                artworks = artworkService.GetListOfLiked(ref totalCount, queryId, 1, 999, "CreatedAt Desc");
            }
            else
            {
                int uid = Convert.ToInt32(Session["UID"]);
                artworks = artworkService.GetListOfLiked(ref totalCount, queryId, uid, 1, 999, "CreatedAt Desc");
            }
        }
    }
}